# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Sébastien Luttringer
# Contributor: L42y <423300@gmail.com>

pkgname=oath-toolkit
pkgver=2.6.9
pkgrel=1
pkgdesc='OATH one-time password toolkit'
arch=('loong64' 'x86_64')
url='https://www.nongnu.org/oath-toolkit/'
license=('GPL3')
depends=('glibc' 'pam' 'xmlsec')
provides=('liboath.so' 'libpskc.so')
validpgpkeys=('B1D2BD1375BECB784CF4F8C4D73CF638C53C06BE') # Simon Josefsson <simon@josefsson.org>
source=("https://download.savannah.nongnu.org/releases/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig})
sha256sums=('333ac831c8f1a6dbd7feb897339bba453ff34d3b0f4cfaa6b5a20dba55c8e985'
            'SKIP')

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr
  make
}

check() {
  cd $pkgname-$pkgver

  make check
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install

  # Install basic docs too
  install -D -m 0644 pam_oath/README "$pkgdir/usr/share/doc/$pkgname/PAM_README"
  install -D -m 0644 README "$pkgdir/usr/share/doc/$pkgname/README"
}
